-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[wasm] First attempt at a wasm app host #68696
Conversation
Tagging subscribers to 'arch-wasm': @lewing Issue Detailsnull
|
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
ff995f4
to
cad622c
Compare
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
d72a7c9
to
5f77c3e
Compare
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It LGTM, and also I tested and it works :)
The failures are known, and have issues filed. |
First attempt at implementing a wasm app host
Regular dotnet apps can be run with
dotnet run
. But this is not the case forwasm apps. We use
xharness
to run the test apps that we generate for librarytests.
Templates for browser, and console wasm projects were added recently, but they
have to be run manually by either invoking a v8 script, or running a
http-server
in the bundle directory. Though to use a debugger with thisrequires starting the debug proxy separately, and connecting few bits.
WasmAppHost
This PR adds a new
WasmAppHost
, which can be used throughdotnet run
:it can run "wasm app" from it's
AppBundle
directory, using various hostslike
v8
,node
, or a browser. An example use:The console template project is run with
node
by default.it supports a
--debug
parameter, which (for the browser case) would startupa webserver, and the debug proxy for Chrome, and firefox.
dotnet run
with wasm samples, and library tests too.How do I try this out?
You'll need a dotnet with the updated packs. For now, you can use:
.. which would install a sdk in
artifacts/bin/dotnet-workload
with all the packs installed.dotnet new wasmconsole
, ordotnet new wasmbrowser
.Debugging library tests
If the runtime was built in
Release
config, then you need to add-p:DebuggerSupport=true
, so the pdbs would get deployedAnd use
--debug
to start the debuggerOpening the url will show a
Run tests
button, which you can click after connecting with the IDE, to start running the testsNotes, and TODO
WasmAppHost
, along with the debug proxy are bundled in theWebAssembly.Sdk
pack right now.additional support adding in the Sdk.
launchSettings.json
, similar to blazorWasmAppHost
depends on host config inruntimeconfig.json
, which can becontrolled by a
runtimeconfig.template.json
in the project directory.Needs more tests, cleanup,
--help
for command line argumentsapp-support.*js
in templates, andtest-main.js
need more work to share the codeFixes #67236